package bean.task;

import entity.task.*;
import dao.task.*;
import entity.tasktype.*;
import entity.user.*;

import java.util.ArrayList;
import java.util.List;
import java.util.Set;

import javax.enterprise.context.RequestScoped;
import javax.faces.bean.ViewScoped;
import javax.inject.Inject;
import javax.inject.Named;

@Named
@RequestScoped
public class TasksListBean {

	private TaskType taskType;
	private User user;
	private String fulfill;
	private List<Task> tasks = new ArrayList<Task>();
	
	@Inject
	private TaskDAO taskDao;
	
	public String searchActionByType(){
		
		tasks = taskDao.findByTaskType(taskType);
		
		return "";
	}
	
	public String searchActionByUser(){
		
		tasks = taskDao.findByUser(user, fulfill);
		
		return "";
	}
	
	
	public TaskType getTaskType() {
		return taskType;
	}
	
	public void setTaskType(TaskType taskType) {
		this.taskType = taskType;
	}
	
	public User getUser(){
		return user;
	}
	public void setUser(User user){
		this.user = user;
	}
	public String getFulfill(){
		return fulfill;
	}
	public void setFulfill(String fulfill){
		this.fulfill = fulfill;
		
	}
	
	public List<Task> getTasks() {
		return tasks;
	}
	
	public void setTasks(List<Task> tasks) {
		this.tasks = tasks;
	}

	public TaskDAO getTaskDao() {
		return taskDao;
	}
	
	public void setTaskDao(TaskDAO taskDao) {
		this.taskDao = taskDao;
	}
	
}